package com.vcredit.creditcat.web;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.vcredit.creditcat.model.ChannelStatisticsConfigOwner_AD;
import com.vcredit.creditcat.vo.ChannelStatisticsConfigOwnerVo;
import com.vcredit.creditcat.service.ChannelStatisticsConfigOwnerService;
import com.vcredit.creditcat.framework.pagination.Page;
 /*
  * @author zhangxingong
  * @version 1.0
  * @since 1.0
 */
@RestController
@RequestMapping("/channelStatisticsConfigOwner")
public class ChannelStatisticsConfigOwnerController extends BaseController {
    
    @Autowired
    private ChannelStatisticsConfigOwnerService channelStatisticsConfigOwnerService;
  
    @RequestMapping(value = "/list")
    public ModelAndView  showPageChannelStatisticsConfigOwner(HttpServletRequest request) {
        return new ModelAndView("channelstatisticsconfigowner/channelStatisticsConfigOwnerList");
    }  
	
	@RequestMapping(value = "/listChannelStatisticsConfigOwner", method = RequestMethod.GET)
	public Page<ChannelStatisticsConfigOwner_AD> findByPageChannelStatisticsConfigOwner(HttpServletRequest request) {
      return channelStatisticsConfigOwnerService.findByPage(makeDefaultCriteria(request));
	}
	
	@RequestMapping(value = "/saveChannelStatisticsConfigOwner", method = RequestMethod.POST)
	public String saveChannelStatisticsConfigOwner(@RequestBody ChannelStatisticsConfigOwnerVo channelStatisticsConfigOwnerVo,HttpServletRequest request) {
	    channelStatisticsConfigOwnerService.save(channelStatisticsConfigOwnerVo);
		return SUCCESS;
	}
	   
    @RequestMapping(value = "/updateChannelStatisticsConfigOwner", method = RequestMethod.PUT)
    public String updateChannelStatisticsConfigOwner(@RequestBody ChannelStatisticsConfigOwner_AD channelStatisticsConfigOwner,HttpServletRequest request) {
        channelStatisticsConfigOwnerService.update(channelStatisticsConfigOwner);
        return SUCCESS;
    }
    
    @RequestMapping(value = "/removeChannelStatisticsConfigOwner", method = RequestMethod.DELETE)
    public String removeChannelStatisticsConfigOwner(@RequestParam("ids") String ids ,HttpServletRequest request) {
        channelStatisticsConfigOwnerService.removeChannelStatisticsConfigOwner(ids);
        return SUCCESS;
    }	
}
